# Maintainer: Keith Maxwell <keith.maxwell@gmail.com>
pkgname=py3-responses
pkgver=0.25.0
pkgrel=1
pkgdesc="Utility library for mocking out the requests Python library"
url="https://pypi.org/project/responses/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-requests
	py3-toml
	py3-urllib3
	py3-yaml
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-flake8
	py3-pytest
	py3-pytest-httpserver
	py3-pytest-tornasync
	py3-tomli-w
	py3-werkzeug
	"
subpackages="$pkgname-pyc"
source="https://github.com/getsentry/responses/archive/$pkgver/responses-$pkgver.tar.gz"
builddir="$srcdir/responses-$pkgver"

replaces=py-responses # Backwards compatibility
provides=py-responses=$pkgver-r$pkgrel # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a947641f8693a5687feeec8ded5b8d7791c18910f96d6c967e1d4576d1ded7d56933971690a3f3f6b3394b3d5abc6f3f78462545fcd572e7dd674d06340c7566  responses-0.25.0.tar.gz
"
